﻿using Library.Collections.Generic;
using Library.Collections.Specialized;
using System;
using System.Xml;
using System.Xml.XPath;

namespace Library.Xml
{
    public static class Extensions
    {
        internal static Uri xml = new Uri("http://www.w3.org/XML/1998/namespace");
        internal static Uri xmlns = new Uri("http://www.w3.org/2000/xmlns/");

        public static XPathNavigator CreateNavigator<TNode>(this ITreeReadOnly<TNode> tree)
            where TNode : ITreeReadOnly<TNode>
        {
            IXPathNavigable navigable = tree as IXPathNavigable;

            if (navigable != null)
            {
                return navigable.CreateNavigator();
            }

            //...

            throw new System.NotImplementedException();
        }
    }
}